home *** CD-ROM | disk | FTP | other *** search
/ Nejlepší hry / Nejlepsi hry.iso / hry / sea of chaos / sea_install.msi / _15C39AAA7726369D39812BD40F01CF6A / _BFFF6357D7E443CE88BA5D007F5C3AD3 < prev    next >
Text File  |  2005-03-23  |  631b  |  29 lines

  1. //simple shader to clip any pixels with a Z coordinate below the water plane
  2. //does not apply lights
  3. //applies vertex diffuse colors and texture sampling
  4. //clips anything below a specified z
  5. //must be used with clipZ2.vsh
  6. //Luke Lenhart
  7. //(C)2004-2005 Digipen Institute of Technology
  8.  
  9. //clip anything below this
  10. float minZ;
  11.  
  12. //base texture
  13. sampler2D sampTex;
  14.  
  15. //shader input
  16. struct PS_INPUT
  17. {
  18.     float PosZ : TEXCOORD1;
  19.     float2 Tex0 : TEXCOORD0;
  20.     float4 Clr : COLOR0;
  21. };
  22.  
  23. //shader
  24. float4 PShader(PS_INPUT In) : COLOR
  25. {
  26.     In.Clr.a*=saturate(In.PosZ-minZ);
  27.     return In.Clr*tex2D(sampTex,In.Tex0);
  28. };
  29.